//
//  CYDiscoveryHttpTool.h
//  CreditAddressBook
//
//  Created by LE on 15/12/18.
//  Copyright © 2015年 Lee. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CYHttpTool.h"
#import "CYSimpleLoanRewardM.h"
#import "CYCarRental.h"
#import "CYCarRewardApplyM.h"
#import "CYCompanyAccount.h"
@class CYCarInfo;
@class LEProgressButton;
@class CYCarCompanyAccount;
@class CYCarUserAccount;
@class CYUserAccount;

@interface CYDiscoveryHttpTool : NSObject


/*!
 *  @brief  车贷联盟申诉
 */
+ (void)handleAppealWithParam:(NSDictionary *)param success:(void(^)(NSString *message))success failure:(HttpRequestFailure2)failure;
/**
 *  公司资金总账表
 */
+ (void)getCompanyAccountBalanceWithParam:(NSDictionary *)param success:(void(^)(CYCompanyAccount *userAccount))success failure:(HttpRequestFailure2)failure;
/*!
 *  @brief  查看自己申请的悬赏
 */
+ (void)getOwnRewoardWithParam:(NSDictionary *)param success:(void(^)(NSArray *simpleList))success failure:(HttpRequestFailure2)failure;
/*!
 *  @brief  我的发布悬赏处理，取消支付
 */
+ (void)cancelPayWithParam:(NSDictionary *)param success:(void(^)(NSString *message))success failure:(HttpRequestFailure2)failure;

/*!
 *  @brief  企业处理查询结果,悬赏处理
 */
+ (void)payApplyWithParam:(NSDictionary *)param success:(void(^)(NSString *message))success failure:(HttpRequestFailure2)failure;

/*!
 *  @brief  企业处理查询结果,悬赏处理
 */
+ (void)handleRewardWithParam:(NSDictionary *)param success:(void(^)(CYCarRewardApplyM *carRewardApply))success failure:(HttpRequestFailure2)failure;

/*!
 *  @brief  申请悬赏
 */
+ (void)saveRewordWithParam:(NSDictionary *)param success:(void(^)(NSString *message))success failure:(HttpRequestFailure2)failure;

/*!
 *  @brief  获取展示
 */
+ (void)getDisplayWithParam:(NSDictionary *)param success:(void(^)(BOOL isDisplay, BOOL isPay))success failure:(HttpRequestFailure2)failure;

/*!
 *  @brief  获取此企业录入的loan
 */
+ (void)getLoanListByCompanyWithParam:(NSDictionary *)param success:(void(^)(NSArray *simpleList))success failure:(HttpRequestFailure2)failure;
/*!
 *  @brief  车贷联盟企业版获取查询结果
 */
+ (void)getLoanSearchWithParam:(NSDictionary *)param success:(void(^)(NSArray *simpleList))success failure:(HttpRequestFailure2)failure;

/*!
 *  @brief  车贷联盟首页数据查询
 */
+ (void)simpleLoanListWithParam:(NSDictionary *)param success:(void(^)(CYSimpleLoanRewardM *reward, NSArray *simpleList, NSArray *rewardList))success failure:(HttpRequestFailure1)failure;

/**
 *  添加车辆信息
 *
 *  @param param
 *  @param failure 
 */
+ (void)addCarInfoWithParam:(CYCarInfo *)carInfo success:(void(^)(NSString *message))success failure:(HttpRequestFailure1)failure;
/**
 *  检查车牌号码是否已发布过
 *
 *  @param number
 *  @param success
 *  @param failure
 */
+ (void)checkPlateNumberWithPlateNumber:(NSString *)number success:(void(^)(NSString *message))success failure:(HttpRequestFailure1)failure;
/**
 *  车辆信息列表
 *
 *  @param number
 *  @param success
 *  @param failure
 */
+ (void)carInfoListWithParam:(NSDictionary *)param success:(void(^)(NSArray *cars))success failure:(HttpRequestFailure1)failure;
/**
 *  添加租车信息
 *
 *  @param carInfo
 *  @param success
 *  @param failure 
 */
+ (void)addCarRentalWithParam:(CYCarRental *)carInfo success:(void(^)(NSString *message))success failure:(HttpRequestFailure1)failure;
/*!
 *  @brief  车贷联盟保存录入的信息
 */
+ (void)saveLoanWithParam:(NSDictionary *)param success:(void(^)(NSString *message))success failure:(HttpRequestFailure2)failure;

/**
 *  根据userId查询租车风险金帐户信息
 *
 *  @param carInfo
 *  @param success
 *  @param failure
 */
+ (void)getCarCompanyAccountByCompanyIdWithParam:(NSDictionary *)prama success:(void(^)(CYCarCompanyAccount *account))success failure:(HttpRequestFailure1)failure;
/**
 *  根据设定的比例计算出公司可用额度
 *
 *  @param param
 *  @param account 风险金账号余额 riskAccount 额度
 *  @param failure
 */
+ (void)getCompanyCarRewardWithParam:(NSDictionary *)param success:(void(^)(NSNumber *account, NSNumber *riskAccount))success failure:(HttpRequestFailure2)failure;
/**
 *  根据userId查询租车风险金帐户信息
 *
 *  @param param
 *  @param success
 *  @param failure
 */
+ (void)getCarUserAccountByUserIdWithParam:(NSDictionary *)param success:(void(^)(CYCarUserAccount *account))success failure:(HttpRequestFailure1)failure;
/**
 *  根据设定的比例计算出用户可用额度
 *
 *  @param param
 *  @param account 风险账号余额 riskAccount 额度
 *  @param failure
 */
+ (void)getUserCarRewardWithParam:(NSDictionary *)param success:(void(^)(NSNumber *account, NSNumber *riskAccount))success failure:(HttpRequestFailure2)failure;
/**
 *  根据userId查询查询个人帐目帐户余额
 *
 *  @param param
 *  @param success
 *  @param failure
 */
+ (void)getUserAccountBalanceWithParam:(NSDictionary *)param success:(void(^)(CYUserAccount *userAccount))success failure:(HttpRequestFailure2)failure;
/**
 *  获取租车列表
 *
 *  @param carInfo
 *  @param success
 *  @param failure
 */
+ (void)carRentalListWithParam:(NSDictionary *)prama userType:(CYCarStatusType)type success:(void(^)(NSArray *carRentalList))success failure:(HttpRequestFailure1)failure;
/**
 *  更新租车信息的发布状态
 *
 *  @param carRental
 *  @param success
 *  @param failure   
 */
+ (void)updateStatusWithParam:(NSDictionary *)carRental success:(void(^)(NSString *message))success failure:(HttpRequestFailure1)failure;
/**
 *  根据号牌查找
 *
 *  @param plateNumber
 *  @param success
 *  @param failure
 */
+ (void)getCarInfoByPlateNumberWithPlateNumber:(NSString *)plateNumber success:(void(^)(CYCarInfo *carInfo))success failure:(HttpRequestFailure1)failure;
/**
 *  根据身份证号码或电话号码或车牌号码查询
 *
 *  @param param
 *  @param success
 *  @param failure
 */
+ (void)creditQueryWithParam:(NSDictionary *)param success:(void(^)(NSString *html))success failure:(HttpRequestFailure2)failure;
/**
 *  租车风险金个人帐号充值
 *
 *  @param param
 *  @param success
 *  @param failure
 */
+ (void)carUserAccountRechargeWithParam:(NSDictionary *)param success:(void(^)(NSString *message))success failure:(HttpRequestFailure2)failure;


/**
 *  用户图片上传
 *
 *  @param image
 *  @param btn
 *  @param completion
 */
+ (void)uploadUserImage:(UIImage *)image button:(LEProgressButton *)btn success:(void (^)(NSString *imagePath))success failure:(HttpRequestFailure1)failure;
@end
